#ifndef __MUSICLISTMANAGER_H__
#define __MUSICLISTMANAGER_H__

namespace SPlayer
{
    namespace Music
    {
        ref class MusicInfo;
    }
    ref class TreeEventDispatcher
    {
    public:
        System::Action<System::String ^/*listName*/, Music::MusicInfo ^/*music info*/> ^onMusicAdded;
        System::Action<System::String ^/*listName*/, Music::MusicInfo ^/*music info*/> ^onMusicRemoved;
        System::Action<System::String ^/*listName*/> ^onListAdded;
        System::Action<System::String ^/*listName*/> ^onListRemoved;
        System::Action<System::String ^/*listName*/, System::String ^/*newListName*/> ^onListRenamed;
    };
    ref class MusicListManager
    {
    public:
        using MusicList = System::Collections::Generic::List < Music::MusicInfo ^ > ;
        using ItemsType = System::Collections::Generic::Dictionary < System::String ^, MusicList ^ > ;
    public:
        bool add(System::String ^listName, Music::MusicInfo ^musicInfo);
        bool addList(System::String ^listName);
        void newList();
        bool removeList(System::String ^listName);
        bool remove(System::String ^listName, Music::MusicInfo ^musicInfo);
        bool renameList(System::String ^listName, System::String ^newName);
    public:
        TreeEventDispatcher ^eventDispatcher = gcnew TreeEventDispatcher;
    public:
        ItemsType ^items = gcnew ItemsType;
    };
}



#endif // __MUSICLISTMANAGER_H__